# -*- coding: utf-8 -*-
"""
Created on Mon Apr 24 19:10:44 2023

@author: 52224
"""
import numpy as np
Die_col=[10300,10300,10300,10300,10300,10300,10300,10300]
Die_row=[10300,10300,10300,10300,10300,10300,10300,10300]
sub_die_row=200
num_of_sub_die=41
die_map=np.array([
                 [0, 0, 0, 1, 1, 1, 0, 0, 0,],
                 [0, 0, 1, 1, 1, 1, 1, 0, 0,],
                 [0, 0, 1, 1, 1, 1, 1, 0, 0,],
                 [1, 1, 1, 1, 1, 1, 1, 1, 1,],
                 [1, 1, 1, 1, 1, 1, 1, 1, 1,],
                 [1, 1, 1, 1, 1, 1, 1, 1, 1,],
                 [0, 0, 1, 1, 1, 1, 1, 0, 0,],
                 [0, 0, 1, 1, 1, 1, 1, 0, 0,],
                 [0, 0, 0, 1, 1, 1, 0, 0, 0,],
                 ])
#=****左下角坐标最大****=#
#=****左上角的die的坐标为0，0=#
X_axis=np.empty([np.size(die_map,0),np.size(die_map,1)])
Y_axis=np.empty([np.size(die_map,0),np.size(die_map,1)])
Home_die=[0,3]
for i in range(np.size(die_map,0)):
    for j in range(np.size(die_map,1)):
        if die_map[i,j] == 0:
            X_axis[i,j] = -999999
            Y_axis[i,j] = -999999
            continue
        if j == Home_die[1]:
            X_axis[i,j] = 0
        elif j < Home_die[1]:
            X_axis[i,j] = sum(Die_col[j:Home_die[1]])
        elif j > Home_die[1]:
            X_axis[i,j] = -sum(Die_col[Home_die[1]:j])
        if i == Home_die[0]:
            Y_axis[i,j] = 0
        elif i < Home_die[0]:
            Y_axis[i,j] = sum(Die_row[i:Home_die[0]])
        elif i > Home_die[0]:
            Y_axis[i,j] = sum(Die_row[Home_die[0]:i])
            